<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02JS变量与常量</title>
</head>
<body>
<script>
    var a = 10;
    var b = 3.14;//整数小数都是number
    var c = '海龙的咆哮';//单引号和双引号都是String
    var d = true;//boolean true + false
    console.log(a,b,c,d);
    // typeof 查看数据类型,根据值去推断数据类型
    console.log(typeof a,typeof b,typeof c,typeof d)

    a=3.14;
    console.log(a);
    console.log(typeof a);
    a = false;
    console.log(a,typeof a);

    var a = '龙卷风';
    console.log(a , typeof a)

    //声明的变量不可以重复声明,报错变量已被声明
    let x = 10;
    console.log(x,typeof x)

    //const 常量
    const y = 1;
    console.log(y ,typeof y)


</script>
</body>
</html>